#!/usr/bin/env python
PACKAGE = "roboteq_control"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("position_mode_velocity",      int_t, 0, "[RPM] Default speed at which move the motor moves in position mode", 0,  0, 30000)
gen.add("turn_min_to_max",             double_t, 0, "When the encoder are used is automatically computed",             0.0,  0, 1000)

gen.add("Kp",               double_t, 0, "Kp gain PID",                  0.0,  0, 25.5)
gen.add("Ki",               double_t, 0, "Ki gain PID",                  0.0,  0, 25.5)
gen.add("Kd",               double_t, 0, "Kd gain PID",                  0.0,  0, 25.5)
gen.add("integrator_limit", int_t, 0, "[#] Integrator limit",            100,  0, 100)

error_detection = gen.enum([ gen.const("detection_disabled",        int_t, 0, "Detection disabled"),
                   gen.const("250ms_at_error_up_100", int_t,  1, "250ms at error > 100"),
		   gen.const("500ms_at_error_up_250", int_t,  2, "500ms at error > 250"),
	           gen.const("1000ms_at_error_up_500", int_t,  3, "1000ms at error > 500")],
                      "loop error detection")
gen.add("loop_error_detection", int_t, 0, "Loop error detection", 0, 0, 3, edit_method=error_detection)

#Default command
gen.add("load_roboteq", bool_t  , 0, "Load all parameters from Roboteq board", False)
gen.add("restore_defaults", bool_t  , 0, "Restore to the original configuration", False      )

exit(gen.generate(PACKAGE, "roboteq_node", "RoboteqPID"))
